package com.zht.enmus;

import lombok.AllArgsConstructor;
import lombok.Getter;


@Getter
@AllArgsConstructor
public enum ErrorCode {

    SUCCESS(0, "操作成功"),
    INTERNAL_SERVER_ERROR(500, "服务器内部错误"),

    // ================= Redis =================
    REDIS_CONNECTION_FAILURE(10001, "Redis连接失败或超时"),
    REDIS_AUTH_FAILURE(10002, "Redis认证失败"),
    REDIS_WRONG_DATA_TYPE(20001, "Redis操作的数据类型不匹配"),

    // ================= 短信服务 =================
    SMS_INVALID_PHONE_NUMBER(60001, "手机号码格式无效"),
    SMS_RATE_LIMIT_EXCEEDED(60003, "发送频率过高"),
    SMS_TEMPLATE_NOT_FOUND(70001, "短信模板不存在"),
    SMS_GATEWAY_AUTH_FAILURE(80002, "短信网关认证失败"),
    SMS_INSUFFICIENT_BALANCE(80003, "短信账户余额不足"),
    SMS_GATEWAY_SEND_FAILURE(80004, "短信网关发送失败"),
    SMS_CODE_INVALID(80005, "验证码不匹配"),
    SMS_CODE_EXPIRED(80006, "验证码不存在或已过期"),
    SMS_CODE_EMPTY(80007, "输入的验证码为空");

    private final int code;
    private final String msg;
}
